/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.farent.solutions.plugins.stripes.hyperstripes.core.tags;

import com.farent.solutions.plugins.stripes.hyperstripes.core.ComponentModel;
import com.farent.solutions.plugins.stripes.hyperstripes.core.DefaultComponentModel;
import com.farent.solutions.plugins.stripes.hyperstripes.core.FormMode;
import com.farent.solutions.plugins.stripes.hyperstripes.core.ModelProvider;

/**
 *
 * @author frenio
 */
@ModelProvider("form")
public class FormComponentModel extends DefaultComponentModel implements ComponentModel
{
    private FormMode mode;
    private String name;

    public FormComponentModel() {
        this.name = "form";
        this.mode = FormMode.EDIT;
    }

    public FormComponentModel(String name) {
        this.name = name;
        this.mode = FormMode.EDIT;
    }

    public FormComponentModel(FormMode mode, String name) {
        this.mode = mode;
        this.name = name;
    }

    @Override
    public boolean isChild(ComponentModel child) {
//        return TagUtils.getNameNoPrefix(child.getName()).equalsIgnoreCase("button");
        return true;
    }
    
    public void setMode(FormMode mode) {
        this.mode = mode;
    }

    public FormMode getMode() {
        return mode;
    }

    @Override
    public String getName() {
        return name;
    }
}
